use std::collections::HashSet;

struct Solution {}

fn main() {}

impl Solution {
    pub fn distribute_candies(candy_type: Vec<i32>) -> i32 {
        let mut candies_map: HashSet<i32> = HashSet::new();
        for i in 0..candy_type.len() {
            candies_map.insert(candy_type[i]);
        }
        if candies_map.len() > candy_type.len() / 2 {
            return candy_type.len() as i32 / 2;
        }
        candies_map.len() as i32
    }
}